/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-07-02 17:35:38
 * @LastEditors: huangjinyao huangjinyao@hjy.cn
 * @LastEditTime: 2024-07-02 18:49:03
 * @FilePath: \小兔仙项目\vue-rabbit\src\views\Category\composables\useBanner.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { ref, onMounted } from "vue";
// 引入接口
import { getBannerAPI } from "@/apis/home";


export function useBanner() {
    const bannerList = ref([]);

    const getBanner = async () => {
        const res = await getBannerAPI({
            distributionSite: "2",
        });
        //console.log(res);
        bannerList.value = res.result;
    };

    onMounted(() => getBanner());

    return { bannerList };
}